Computer programs are often compiled from multiple separate source code files by a compiler. Typically, the compiler compiles each separate source code file included in the program into a separate object file. Each of these object files includes a text section and a read only data section. The text section includes one or more instructions to be performed when the respective object file is executed. The read only data section includes data that may be used during the execution of the instructions in the text section. Such data often includes run-time type information regarding objects referenced and/or manipulated by the instructions.
For example, the C++ programming language typically includes run-time type information regarding polymorphic objects in the read only data sections of object files, though not run-time type information regarding non-polymorphic objects. Polymorphic objects are objects that can be one of multiple different types, such a Canine object that can be a Wolf type or a Dog type. The C++ programming language typically stores run-time type information regarding polymorphic objects as polymorphic objects utilize different functions depending on the type of the polymorphic object and the program accesses the run-time information to select the appropriate function.
Run-time type information stored in the read only data section of object files may be redundant. If the program never uses the type information, it is redundant because it is unnecessarily stored. If the same type information is stored in the read only sections of different object files in the same program, it is unnecessary because it is stored in duplicate. Some compilers allow programmers to specify that type information is never utilized for any objects in the program. As such, the compiler does not generate type information to include in object files. However, this approach does not remove unneeded type information, instead the program is not allowed to use any type information. Other compilers place all type information in a single location. This prevents duplicate type information from being generated. However, this approach makes object files more complicated and still does not remove unneeded type information.